﻿@inherits System.Web.Mvc.WebViewPage<IEnumerable<Pikapika.Models.NovelChapter>>

@{
    ViewBag.Title = "NovelChapter - List";
    
}

    <table>
        <tr>
            <th></th>
            <th>
                Id
            </th>
            <th>
                Name
            </th>
            <th>
                NovelVolumeId
            </th>
            <th>
                ChapterContent
            </th>
            <th>
                UpdatedDate
            </th>
            <th>
                RatingPoints
            </th>
            <th>
                RatingCount
            </th>
            <th>
                SortIndex
            </th>
            <th>
                PostUserName
            </th>
        </tr>

    @foreach (var item in Model) {
    
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
                @Html.ActionLink("Edit (Rich)", "EditRichText", new { id=item.Id }) |
                @Html.ActionLink("Details", "Details", new { id=item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.Id })
            </td>
            <td>
                @item.Id
            </td>
            <td>
                @item.Name
            </td>
            <td>
                @item.NovelVolumeId ( @item.NovelVolume.Novel.Name - @item.NovelVolume.Name )
            </td>
            <td>
                @item.ChapterContent.AutoEllipsis(20)
            </td>
            <td>
                @String.Format("{0:g}", item.UpdatedDate)
            </td>
            <td>
                @item.RatingPoints
            </td>
            <td>
                @item.RatingCount
            </td>
            <td>
                @item.SortIndex
            </td>
            <td>
                @item.PostUserName
            </td>
        </tr>
    
    }

    </table>

    <p>
        @Html.ActionLink("Create New", "Create") | 
        @Html.ActionLink("Create Batch", "CreateBatch") | 
        @Html.ActionLink("Create Batch (RichText)", "CreateBatchRichText") | 
        @Html.ActionLink("Back to novel volumes", "Index", "NovelVolume", new { novelId = Model.Any() ? (object)Model.First().NovelVolume.NovelId : null }, null)
    </p>


